package org.yjhking.feignclient;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.yjhking.dto.Movie;
import org.yjhking.query.AjaxResult;

@FeignClient(value = "movie-server", fallbackFactory = MovieFeignClientFallbackFactory.class) // 指定需要调用的服务的应用名称
public interface MovieFeignClient {
    @GetMapping
    public AjaxResult getMovieList();
    
    @PostMapping("/buy")
    public AjaxResult buy(@RequestBody Movie movie);
    
    @GetMapping("/free/{id}")
    public AjaxResult free(@PathVariable Long id);
    
    @PostMapping("/watch")
    public AjaxResult watchMovie(@RequestBody Movie movie);
}